import { IndexRedirect, IndexRoute, Route, Router } from 'react-router'; // 路由
import React, { Component } from 'react';

import App from './pages/App';
import { DIST } from 'conf';
import Index from './pages/index/Index';

class Routers extends Component {
    leavePath() {
        // ...
    }
    enterPath() {
        document.body.scrollTop = 0;
    }
    render() {
        return (
            <Router history={this.props.history}>
                <Route path={DIST} component={App}>
                    <Route onEnter={this.enterPath} path={DIST + '/'} component={Index} />
                    <IndexRoute component={Index} />
                </Route>
            </Router>
        );
    }
}

export default Routers;